<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<div class="pad-lr-10">
	<form name="searchform" action="" method="get">
		<input type="hidden" value="activity" name="m">
		<input type="hidden" value="activity" name="c">
		<input type="hidden" value="index" name="a">
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
			<tr>
				<td>
					<div class="explain-col">

						<select name="type">
							<option value='1'
								<?php if(isset($_GET['type']) && $_GET['type']==1){?> selected
								<?php }?>><?php echo  L("contest_name")?></option>
							<option value='2'
								<?php if(isset($_GET['type']) && $_GET['type']==2){?> selected
								<?php }?>><?php echo L("contest_year")?></option>
							<option value='3'
								<?php if(isset($_GET['type']) && $_GET['type']==3){?> selected
								<?php }?>>活动详细地址</option>

						</select>
						<input name="keyword" type="text" value="<?php if(isset($_GET['keyword'])) {echo $_GET['keyword'];}?>"
										 class="input-text" />
						<input type="submit" name="search"  class="button" value="<?php echo L('search')?>" />
					</div>
				</td>
			</tr>
			</tbody>
		</table>
	</form>


	<form name="myform" action="?m=activity&c=activity&a=delete" method="post"
		onsubmit="return confirm('<?php echo L('confirm')?>')">
		<div class="table-list">
			<table width="100%" cellspacing="0">
				<thead>
					<tr>
						<th align="center" width="20"><input type="checkbox" value=""
							id="check_box" onclick="selectall('id[]');"></th>
						<th width="40"><?php echo L('listorder');?></th>
						<th align="center" width="40">ID</th>
						<th align="center" ><?php echo L("contest_name") ?></th>
						<th align="center" width='60px'><?php echo L("contest_year") ?></th>
						<th align="center" width='80px'><?php echo L("宣传图") ?></th>
						<th align="center" width='80px'><?php echo "开始时间"; ?></th>
						<th align="center" width='80px'><?php echo "结束时间"; ?></th>
						<th align="center" width='80px'><?php echo L("contest_type") ?></th>
						<th align="center" width='100px'>活动详细地址</th>
						<th align="center" width='70px'><?php echo "上次编辑者"; ?></th>
						<th align="center" width="150"><?php echo L("operation") ?></th>
					</tr>
				</thead>
				<tbody>
<?php
if(!empty($lists)){
foreach ($lists as $k => $v) {
    ?>
    <tr>
		<td align="center"><input type="checkbox"
			value="<?php echo $v['id']?>" name="id[]"></td>
		<td align='center'><input name='listorders[<?php echo $v['id'];?>]' type='text' size='3' value='<?php echo $v['sort'];?>' class='input-text-c'></td>
		<td align="center"><?php echo $v['id'];?></td>
		<td align="center"><?php  if(!empty($v['name'])){echo $v['name'];}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($v['year'])){echo $v['year'];}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(isset($v['image_logo']) && !empty($v['image_logo'])){?><img src="<?=$v['image_logo']?>"  height="60" /><?php }else{echo "<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($v['begin_time'])){echo date('Y-m-d',strtotime($v['begin_time']));}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($v['end_time'])){echo date('Y-m-d',strtotime($v['end_time']));}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($types[$v['type']])){echo $types[$v['type']];}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($v['address_detail'])){echo $v['address_detail'];}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center"><?php if(!empty($v['updated_by'])){echo $adminInfo[$v['updated_by']];}else{echo"<span style='color:red;'>（未设置）</span>";}?></td>
		<td align="center">
			<a  href="?m=activity&c=activity&a=edit&id=<?php echo $v['id']?>"><?php echo  L("edit");?></a> | 
			<a href="?m=activity&c=activity&a=delete&id=<?php echo $v['id']?>"
			onClick="return confirm('<?php echo L('confirm')?>')"><?php echo  L($column."delete")  ?></a> | 
			<a  href="?m=activity&c=activity&a=source&source_type=1&id=<?php echo $v['id']?>">关联资源</a>

		</td>
	</tr>
<?php
}
}else{
    echo "<tr><td colspan='11' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
}
?>
</tbody>
			</table>

			<div class="btn">
				<label for="check_box"><a href="#"
					onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('select_all')?></a>/<a
					href="#"
					onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a></label>
				<input type="button" class="button" value="<?php echo L('listorder');?>" onclick="myform.action='?m=activity&c=activity&a=listorders&dosubmit=1&steps=<?php echo $steps;?>';myform.submit();"/>
				<input type="submit" class="button" name="dosubmit"
					value="<?php echo L('delete')?>" />
			</div>

<div id="pages"><?php echo $pages?></div>
		</div>
	</form>
</div>
</body>
</html>